package com.small.springframework.beans;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author zhoujin
 * @Date 2022/3/29 20:41
 */
public class PropertyValues {
    List<PropertyValue> propertyValueList = new ArrayList();


    public void addPropertyValue(PropertyValue pv){
        this.propertyValueList.add(pv);
    }

    public PropertyValue[] getPropertyValues() {
        return this.propertyValueList.toArray(new PropertyValue[0]);
    }

    PropertyValue getPropertyValue(String name){
        for (PropertyValue propertyValue:propertyValueList) {
            if (propertyValue.getName() == propertyValue.getName()){
                return propertyValue;
            }
        }
        return null;
    }
}
